<template>
  <div>
    <h2>绑定class属性</h2>
    <p v-bind:class="classname">1111</p>
    <p :class="classname">222</p>
    <p class="box">333</p>
  </div>
</template>
<script setup>
const classname = "box1";
</script>
<style>
.box {
  width: 100px;
  height: 100px;
  background-color: red;
}
.box1 {
  width: 100px;
  height: 100px;
  background-color: green;
}
</style>
